import Vue from 'vue'
import Vuex from 'vuex'
import persistedState from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  plugins: [persistedState()],
  state: {
    show:false,
    postid:60601,
    showSearch:false,
    collectionLists:[],//收藏
    comment:[],//我的点赞评论
    myCommennt:[], //我的评论,
     use:false
  },
  mutations: {
    ShowPopup(state,[val,id]){
      state.show=val,
      state.postid=id
    },
    ClosePopup(state,val){
      state.show=val;
      state.postid=''
    },
    Inside(state,val){
      state.postid=val
    },
    showSearchPopup(state,val){
      state.showSearch=val
    },
    addCollectionLists(state,val){
      state.collectionLists.push(val)
    },
    addComment(state,val){
      state.comment.push(val)
    },
    addmyCommennt(state,val){
      state.myCommennt.push(val)
    },
    changeUse(state,val){
      state.use=val
    },
    delAll(state,val){
      state.collectionLists=val
       state.comment=val
       state.myCommennt=val
    }
  },
  actions: {
  },
  modules: {
  }
})
